package com.atguigu.day09.test.o3;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/9 10:58
 * @注释 定义一个父类Person，声明姓名，年龄，性别，以及相对应的有参构造器
 */

public class Person {
    private String name;
    private int age;
    private char gender;

    /*public String getInfo(){
        return "姓名： " + name + ", 年龄： " + age + ", 性别： " + gender;
    }*/

    @Override
    public String toString() {
        return "name='" + name + '\'' +
                ", age=" + age +
                ", gender=" + gender;
    }

    public Person(String name, int age, char gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public Person() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }
}
